<!--
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author ThinkGem
-->
<template>
  <div>
    <BasicTable @register="registerTable">
      <template #tableTitle>
        <!-- 紧急程度：普通 -->
        <Icon :icon="getTitle.icon" class="m-1 pr-1" />
        <span> {{ title }} </span>
      </template>
      <template #toolbar>
        <a-button
          v-for="(item, index) in butData"
          :key="index"
          :type="item.type"
          @click="item.onClick"
          v-auth="item.auth"
        >
          <Icon v-if="item.icon" :icon="item.icon" /> {{ t(item.title) }}
        </a-button>
      </template>
      <template #firstColumn="{ column, record }">
        <div v-if="column.dataIndex == 'overQty'">
          <a
            @click="orderFlowAdd(record.id)"
            style="display: flex; line-height: 30px"
            v-if="record.oper.canOver == '1'"
          >
            <Icon
              icon="ant-design:fast-forward-outlined"
              style="margin-right: 10px; font-size: 30px"
            />
            {{ record.overQty ? record.overQty : '无' }}
          </a>
        </div>
        <div v-if="column.dataIndex == 'moreQty'">
          <a
            @click="orderMoreAdd(record.id)"
            style="display: flex; line-height: 30px"
            v-if="record.oper.canOver == '1'"
          >
            <Icon
              icon="ant-design:fast-forward-outlined"
              style="margin-right: 10px; font-size: 30px"
            />
            {{ record.moreQty ? record.moreQty : '无' }}
          </a>
        </div>
        <div v-if="column.dataIndex == 'fcQty'">
          <a
            @click="orderWxOutAdd(record.id)"
            style="display: flex; line-height: 30px"
            v-if="record.oper.bout == '1'"
          >
            <Icon
              icon="ant-design:fast-forward-outlined"
              style="margin-right: 10px; font-size: 30px"
            />
            {{ record.fcQty ? record.fcQty : '无' }}
          </a>
        </div>
        <div v-if="column.dataIndex == 'checkQty'">
          <a
            @click="orderCheckList(record.id)"
            style="display: flex; line-height: 30px"
            v-if="record.oper.bcheck == '1'"
          >
            <Icon
              icon="ant-design:fast-forward-outlined"
              style="margin-right: 10px; font-size: 30px"
            />
            {{ record.checkQty ? record.checkQty : '无' }}
          </a>
        </div>

        <div v-if="column.dataIndex == 'oper'">
          <p>({{ record.oper.operCode }}) {{ record.oper.operName }}</p>
        </div>
      </template>
      <!-- 自定义操作按钮 -->
      <template #operate="{ record }">
        <!-- <a-button
          type="default"
          @click="downLoadPic(record)"
          size="small"
          v-auth="'m8:order:pic:download'"
          style="background: #1890ff; color: #fff; margin-right: 5px"
        >
          <Icon icon="ant-design:snippets-outlined" /> {{ t('下载图纸') }}
        </a-button> -->
        <BasicUpload
          v-model:value="record.orderPic.dataMap"
          :bizKey="record.orderPic.id"
          :bizType="'m8OrderPic_file'"
          :readonly="true"
          style="display: inline-block; margin-right: 10px"
        />
        <a-button
          type="default"
          @click="clear1(record)"
          size="small"
          v-auth="'m8:order:pic:reset'"
          style="background: #ddd; color: #444; margin-right: 5px"
        >
          <Icon icon="simple-line-icons:action-undo" /> {{ t('撤销') }}
        </a-button>

        <div v-if="record.oper.operCode == 'BC'" style="margin-top: 10px">
          <!-- record.orderPic.needSx == '1' &&record.orderPic.bsxset != '1' -->
          <a-button
            type="default"
            @click="handleRouterList(record)"
            size="small"
            v-auth="'m8:order:sx:add'"
            style="background: #00c0ef; color: #fff; margin-right: 5px"
          >
            <Icon icon="ant-design:check-square-outlined" />
            {{ record.orderPic.bsxset == '1' ? '查看数铣' : '数铣配置' }}
          </a-button>
        </div>

        <!-- <a-button
          type="default"
          @click="handleRouterList(record)"
          v-auth="'m8:order:sx:add'"
          size="small"
          style="background: #00c0ef; color: #fff; margin-right: 5px"
        >
          <Icon icon="ant-design:check-square-outlined" /> {{ t('数铣配置') }}
        </a-button> -->

        <div v-if="record.oper.canOver == '1' && record.flowStatus != '2'" style="margin-top: 10px">
          <a-button
            type="default"
            @click="addOverData(record)"
            size="small"
            v-auth="'m8:order:flow:over:add'"
            style="background: #00acd6; color: #444; margin-right: 5px"
          >
            <Icon icon="ant-design:check-square-outlined" /> {{ t('完成') }}
          </a-button>
        </div>

        <div style="margin-top: 10px">
          <!-- v-if="record.oper.bcheck == '1'" -->
          <a-button
            type="default"
            @click="handleCheck(record)"
            v-if="record.oper.bcheck == '1'"
            size="small"
            style="background: #00c0ef; color: #fff; margin-right: 5px"
          >
            <Icon icon="ant-design:check-square-outlined" /> {{ t('检验') }}
          </a-button>
        </div>

        <div v-if="record.oper.canbl == '1'" style="margin-top: 10px">
          <a-button
            type="default"
            @click="addMoreData(record)"
            size="small"
            v-auth="'m8:order:flow:more:add'"
            style="background: #f39c12; color: #fff; margin-right: 5px"
          >
            <Icon icon="ant-design:check-square-outlined" /> {{ t('补领料') }}
          </a-button>
        </div>

        <div v-if="record.oper.bout == '1'" style="margin-top: 10px">
          <a-button
            type="default"
            @click="handleOut({ id: record.id })"
            size="small"
            v-auth="'m8:order:flow:ww:add'"
            style="background: #f39c12; color: #fff; margin-right: 5px"
          >
            <Icon icon="ant-design:check-square-outlined" /> {{ t('发料') }}
          </a-button>
          <!-- <a-button
            type="default"
            @click="handleOut({ id: record.id, ope: record.fcQty > 0 ? 'edit' : '-1' })"
            size="small"
            v-auth="'m8:order:flow:ww:add'"
            style="background: #f39c12; color: #fff; margin-right: 5px"
          >
            <Icon icon="ant-design:check-square-outlined" /> {{ t('复制') }}
          </a-button> -->
        </div>
        <div v-if="record.oper.operCode == 'FH'" style="margin-top: 10px">
          <a-button
            type="default"
            @click="handleFH(record)"
            size="small"
            v-auth="'order:flow:fh:edit'"
            style="background: #f39c12; color: #fff; margin-right: 5px"
          >
            <Icon icon="ant-design:check-square-outlined" /> {{ t('发货') }}
          </a-button>
        </div>
      </template>
      <!-- 流程插槽 -->
      <!-- <template #oper_operCode="{ record }">
        <a @click="handleForm({ id: record.id })">
          {{ record.ccode }}
        </a>
      </template> -->
      <template v-if="!props.data.id" #picno="{ record }">
        <a
          @click="handleOrder({ id: record.order.id, picno: record.orderPic.picno, activeKey: 2 })"
        >
          {{ record.orderPic.picname }}
        </a>
      </template>
      <template v-if="!props.data.id" #ccode="{ record }">
        <a @click="handleOrder({ id: record.order.id })">
          {{ record.order.ccode }}
        </a>
      </template>
      <template #form-checkbox="{ model, field }">
        <Checkbox v-model:checked="model[field]"> </Checkbox>
      </template>
    </BasicTable>
    <InputForm @register="registerDrawer" @success="handleSuccess" />
    <LastForm @register="registerLastDrawer" @success="handleSuccess" />
    <!-- <FormAuthDataScope @register="registerAuthDataSourceDrawer" @success="handleSuccess" /> -->

    <BasicModal @register="register1" :title="'信息'" @ok="handleSubmit1">
      <div style="margin-top: 20px; font-size: 20px">
        <Icon
          icon="simple-line-icons:question"
          style="margin-right: 10px; color: #f39c12; font-size: 30px"
        />
        确认修改[已完成]状态？
      </div>
      <!-- <template #footer>
        <a-button type="primary" class="mr-2">
          <Icon icon="ant-design:check-outlined" />
          确定
        </a-button>
        <a-button type="info" class="mr-2">
          <Icon icon="ant-design:line-outlined" />
          清除
        </a-button>
        <a-button type="info" class="mr-2">
          <Icon icon="ant-design:close-outlined" />
          关闭
        </a-button>
      </template> -->
    </BasicModal>

    <Modal @register="register" @success="handleSuccess" />

    <BasicModal
      @register="register2"
      :title="'数铣工艺选择'"
      width="60%"
      :showFooter="true"
      @ok="handleSubmit"
    >
      <Route ref="routeList" :data="routeData" @success="handleSuccess" />
    </BasicModal>

    <OverForm @register="registerOver" @success="handleSuccess" />
    <MoreForm @register="registerMoreDrawer" @success="handleSuccess" />
    <SxForm @register="register4" @success="handleSuccess" />
    <OperCheck @register="registerOpenCheckDrawer" @success="handleSuccess" />
    <FormTabs @register="registerOpenFHDrawer" @success="handleSuccess" />
    <!-- 外协 -->
    <wxOut @register="registerOpenOutDrawer" @success="handleSuccess" />
    <BasicDrawer
      v-bind="$attrs"
      :showFooter="false"
      @register="registerDrawer5"
      width="80%"
      title="完工"
    >
      <OverList :orderFlow="orderFlow" />
    </BasicDrawer>
    <!-- 补领数 -->
    <BasicDrawer
      v-bind="$attrs"
      :showFooter="false"
      @register="registerDrawer6"
      width="80%"
      title="补领料明细"
    >
      <MoreList :orderFlow="orderFlow" />
    </BasicDrawer>
    <!-- 发料数 -->
    <BasicDrawer
      v-bind="$attrs"
      :showFooter="false"
      @register="registerDrawerWxOut"
      width="80%"
      title="发料明细"
    >
      <wxOutList :orderFlow="orderFlow" />
    </BasicDrawer>
    <!-- 检验数 -->
    <BasicDrawer
      v-bind="$attrs"
      @register="registerCheckDrawer"
      :showFooter="false"
      width="80%"
      title="检验明细"
    >
      <CheckList :orderFlow="orderFlow" />
    </BasicDrawer>
    <!-- 流程对应检验单选择 -->
    <ListSelect
      @success="handleSuccess"
      selectType="operCheckSelect"
      :selectList="selectListRef"
      :checkbox="false"
      :params="queryParams"
      @select="handleCheckSelects"
      ref="operCheckSelectRefs"
      v-show="false"
    />
    <OrderFormTabs @register="registerOrderFormDrawer" @success="handleSuccess" />
  </div>
</template>
<script lang="ts">
  export default defineComponent({
    name: 'ViewsM8OrderFlowFlowList',
  });
</script>
<script lang="ts" setup>
  import { defineComponent, ref, computed, onMounted } from 'vue';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { useMessage } from '/@/hooks/web/useMessage';
  import { router } from '/@/router';
  import { Icon } from '/@/components/Icon';
  import { BasicTable, BasicColumn, useTable } from '/@/components/Table';
  // import { roleDisable, roleEnable } from '/@/api/sys/role';
  import { useDrawer } from '/@/components/Drawer';
  import { FormProps } from '/@/components/Form';
  import InputForm from './form.vue';
  import LastForm from './lastForm.vue';
  import { orderFlowListData } from '/@/api/order/order';
  import { useModal } from '/@/components/Modal';
  import { BasicModal } from '/@/components/Modal';
  import Modal from './Modal.vue';
  import OverForm from '../over/overForm.vue';
  import MoreForm from '/@/views/m8/order/flow/more/moreForm.vue';
  import Route from '/@/views/bas/route/list.vue';
  import SxForm from '/@/views/m8/order/flow/flow/sxForm.vue';
  import { overOrder, fileList, clear } from '/@/api/m8/order/order';
  import { checkListData } from '/@/api/m8/order/m8OperCheck';
  import { BasicUpload } from '/@/components/Upload';
  import OperCheck from '/@/views/m8/order/flow/check/form.vue';
  import FormTabs from '/@/views/m8/order/flow/fh/formTabs.vue';
  import wxOut from '/@/views/m8/order/flow/wx/m8OrderFlowWxOut/form.vue';
  import wxOutList from '/@/views/m8/order/flow/wx/m8OrderFlowWxOut/listSum.vue';
  import { BasicDrawer } from '/@/components/Drawer';
  import { officeTreeData } from '/@/api/sys/office';
  import OverList from '../over/list.vue';
  import MoreList from '../more/list.vue';
  import CheckList from '../check/list.vue';
  import { ListSelect } from '/@/components/ListSelect';
  import OrderFormTabs from '../../order/formTabs.vue';
  import { schemasData, tabConfigData } from '/@/utils/custom';
  import { listSet, customListData } from '/@/api/test/testData';
  import { Checkbox } from 'ant-design-vue';
  import { handleExport } from '/@/utils/export';

  let orderFlow = ref<any>();
  const { t } = useI18n('sys.role');
  const { showMessage } = useMessage();
  const props = defineProps({
    data: { type: Object, default: {} },
    'oper.operCode': { type: String, default: '' },
  });
  //配置表单内容
  const searchForm = ref<FormProps>({
    baseColProps: { lg: 6, md: 8 }, // 表单栅格布局
    labelWidth: 80, // 表单标签宽度
    showAdvancedButton: true,
    schemas: [],
    resetFunc: handleReset,
  });
  let tableColumns = ref<any>([]);
  let layVoucherView = ref<any>({});
  let listTabConfig = ref<any>({});
  const getTitle = ref({
    // 表格标题图标
    icon: router.currentRoute.value.meta.icon || 'ant-design:book-outlined',
    value: listTabConfig.value.title,
  });
  let title = ref('');

  let routeData = ref<any>();
  let routeList = ref<any>(null);
  const selectListRef = ref<Recordable[]>([]);
  let queryParams = ref({});
  let operCheckSelectRefs = ref<any>(null);

  const [registerOrderFormDrawer, { openDrawer: openOrderFormDrawer }] = useDrawer();
  const [
    registerDrawer5,
    { openDrawer: openDrawer5, closeDrawer, setDrawerProps: setDrawer5Props },
  ] = useDrawer();
  const [register1, { openModal: openModal1, closeModal: closeModal1 }] = useModal();
  const [register2, { openModal: openModal2, closeModal }] = useModal();
  const [register3, { openModal: openModal3 }] = useModal();
  const [registerCheckDrawer, { openDrawer: openCheckDrawer }] = useDrawer();
  const [registerDrawer6, { openDrawer: openDrawer6 }] = useDrawer();
  const [registerDrawerWxOut, { openDrawer: openDrawerWxOut }] = useDrawer();
  const [registerOver, { openDrawer: openOverDrawer }] = useDrawer();
  const [register4, { openDrawer: openDrawer4 }] = useDrawer();
  const [registerMoreDrawer, { openDrawer: openMoreDrawer }] = useDrawer();
  const [registerOpenCheckDrawer, { openDrawer: openDrawerCheck }] = useDrawer();
  const [registerOpenOutDrawer, { openDrawer: openDrawerOut }] = useDrawer();
  const [registerOpenFHDrawer, { openDrawer: openDrawerFH }] = useDrawer();

  function handleConfirm() {
    openModal1(true);
  }
  async function handleSubmit1() {
    const res = await overOrder({ id: props.data.id });
    showMessage(res.message);
    setTimeout(closeModal1);
  }

  let butData = ref([
    {
      type: 'default', //	按钮类型，可选值为 primary | info | warning | danger | default
      auth: 'm8:order:overOrder', //权限
      icon: 'ant-design:check-square-outlined', //图标代码
      title: '完成订单', //按钮显示内容
      onClick: () => handleConfirm(), //点击触发事件
    },
    {
      type: 'default', //	按钮类型，可选值为 primary | info | warning | danger | default
      auth: 'm8:order:flow:price', //权限
      icon: '', //图标代码
      title: '￥ 设定工序单价', //按钮显示内容
      onClick: () => handOpenModal('设定工序单价'), //点击触发事件
    },
    {
      type: 'default', //	按钮类型，可选值为 primary | info | warning | danger | default
      auth: 'btn:order:flow:manager', //权限
      icon: 'simple-line-icons:people', //图标代码
      title: '指定负责人', //按钮显示内容
      onClick: () => handOpenModal('指定负责人'), //点击触发事件
    },
    {
      type: 'default', //	按钮类型，可选值为 primary | info | warning | danger | default
      auth: 'btn:order:flow:lastDate', //权限
      icon: 'simple-line-icons:calendar', //图标代码
      title: '截止日期(批量)', //按钮显示内容
      onClick: () => handLastForm(), //点击触发事件
    },
    {
      type: 'default', //	按钮类型，可选值为 primary | info | warning | danger | default
      auth: 'btn:order:flow:lastDate', //权限
      icon: 'simple-line-icons:calendar', //图标代码
      title: '截止日期', //按钮显示内容
      onClick: () => handOpenModal('截止日期'), //点击触发事件
    },
    {
      type: 'default', //	按钮类型，可选值为 primary | info | warning | danger | default
      auth: 'btn:order:flow:hfDate', //权限
      icon: 'simple-line-icons:calendar', //图标代码
      title: '回复日期', //按钮显示内容
      onClick: () => handOpenModal('回复日期'), //点击触发事件
    },
    {
      type: 'default', //	按钮类型，可选值为 primary | info | warning | danger | default
      auth: '', //权限
      icon: 'ant-design:download-outlined', //图标代码
      title: ' 导出', //按钮显示内容
      onClick: () => btnExport(),
      //handleExport('/m8/order/flow/exportData?oper.operCode=' + props['oper.operCode']), //点击触发事件
    },
  ]);
  const [register, { openModal }] = useModal();
  const [registerDrawer, { openDrawer }] = useDrawer();
  const [registerLastDrawer, { openDrawer: openLastDrawer }] = useDrawer();
  const [registerTable, { reload, getSelectRows, setProps, getForm }] = useTable({
    // api: orderFlowListData,
    ellipsis: false,
    columns: tableColumns,
    // actionColumn: actionColumn,
    formConfig: searchForm.value as FormProps,
    resizeHeightOffset: props.data.id ? 60 : 0,
    rowSelection: {
      type: 'checkbox',
    },
  });
  onMounted(async () => {
    const res = await listSet({ viewCode: 'M8_flow_list' });
    title.value = res.layVoucherView.name;
    layVoucherView.value = res.layVoucherView;

    searchForm.value.schemas = schemasData(layVoucherView.value.listQuery.queryCols);
    searchForm.value.schemas?.forEach((item) => {
      if (item.component == 'TreeSelect') {
        item.componentProps = {
          api: officeTreeData,
          // treeCheckable: true,, isShowCode: true
          params: { isLoadUser: true, userIdPrefix: '', isAll: true, isShowCode: true },
          canSelectParent: false,
          allowClear: true,
        };
      }
      if (item.component == 'CheckboxGroup') {
        item.slot = 'checkbox';
      }
    });

    tableColumns.value = layVoucherView.value.flistTabCols; //表格表头
    tableColumns.value.push({
      title: t('操作'),
      width: 150,
      align: 'left',
      fixed: 'right',
      slot: 'operate',
    });

    listTabConfig.value = tabConfigData(res.layVoucherView.listTabConfig);
    setProps({
      api: customListData,
      beforeFetch: (params) => {
        for (const key in params) {
          if (Array.isArray(params[key])) {
            params[key + '_gte'] = params[key][0];
            params[key + '_lte'] = params[key][1];
            delete params[key];
          }
          if (typeof params[key] == 'boolean') {
            params[key] = params[key] ? '1' : '0';
          }
        }
        params.url = listTabConfig.value.api;
        params['order.id'] = props.data.id;
        if (props['oper.operCode'] != '') {
          params['oper.operCode'] = props['oper.operCode'];
        }
        return params;
      },
      autoCreateKey: listTabConfig.value.autoCreateKey,
      bordered: listTabConfig.value.bordered,
      canResize: listTabConfig.value.canResize,
      clearSelectOnPageChange: listTabConfig.value.clearSelectOnPageChange,
      clickToRowSelect: listTabConfig.value.clickToRowSelect,
      // ellipsis: listTabConfig.value.ellipsis,
      emptyDataIsShowTable: listTabConfig.value.emptyDataIsShowTable,
      inset: listTabConfig.value.inset,
      isTreeTable: listTabConfig.value.isTreeTable,
      pagination: listTabConfig.value.pagination,
      showIndexColumn: listTabConfig.value.showIndexColumn,
      showSummary: listTabConfig.value.showSummary,
      showTableSetting: listTabConfig.value.showTableSetting,
      striped: listTabConfig.value.striped,
      useSearchForm: listTabConfig.value.useSearchForm,
      tableSetting: listTabConfig.value.tableSetting,
      titleHelpMessage: listTabConfig.value.titleHelpMessage,
      maxHeight: listTabConfig.value.maxHeight,
      // resizeHeightOffset: listTabConfig.value.resizeHeightOffset,
    });
    setTimeout(() => {
      getForm().setFieldsValue({
        'oper.operCode': props['oper.operCode'],
      });
    }, 0);

    if (!listTabConfig.value.immediate) {
      reload({
        searchInfo: {
          'oper.operCode': props['oper.operCode'],
        },
      });
    }
  });

  function handleReset() {
    getForm().setFieldsValue({
      'oper.operCode': props['oper.operCode'],
    });
  }

  function handOpenModal(title) {
    // console.log(getSelectRows());
    if (getSelectRows().length == 1) {
      openModal(true, { ...getSelectRows()[0], title });
    } else {
      showMessage('请选择一行数据！！');
    }
  }
  //批量修改截止时间
  function handLastForm() {
    const selectRow = getSelectRows();
    if (selectRow.length == 1) {
      let picId = selectRow[0].orderPic.id;
      openLastDrawer(true, { id: picId });
    } else {
      showMessage('请选择一行数据！！');
    }
  }

  // 补领料按钮
  async function addMoreData(record: Recordable) {
    let obj = {
      'orderFlow.id': record.id,
    };
    openMoreDrawer(true, obj);
  }

  function orderFlowAdd(record) {
    orderFlow.value = record;
    let props = {
      maskClosable: true,
    };
    setDrawer5Props(props);
    openDrawer5(true);
  }

  // 补领数
  function orderMoreAdd(record) {
    // console.log(record);
    orderFlow.value = record;
    openDrawer6(true);
  }

  // 发料数
  function orderWxOutAdd(record) {
    // console.log(record);
    orderFlow.value = record;
    openDrawerWxOut(true);
  }

  function choseSxRoute(record) {
    // console.log(record);
    openModal2(true, record);
  }

  async function downLoadPic(record: Recordable) {
    // console.log(record);
    let data = {
      bizKey: record.orderPic.id,
      bizType: 'm8OrderPic_file',
    };
    const res = await fileList(data);
    showMessage(res.message);
    // handleSuccess();
  }

  async function clear1(record: Recordable) {
    let data = {
      bizKey: record.id,
    };
    const res = await clear(data);
    showMessage(res.message);
  }

  async function addOverData(record: Recordable) {
    let obj = {
      orderFlow: {
        id: record.id,
      },
    };
    openOverDrawer(true, obj);
  }

  function handleSuccess() {
    setTimeout(closeModal);
    reload();
  }

  // 数铣工艺选择
  function handleRouterList(record) {
    if (record.orderPic.bsxset == '1') {
      openDrawer4(true, { id: record.orderPic.id });
    } else {
      routeData.value = record;
      routeData.value.flag = '1';
      openModal2(true, '');
    }
  }

  // 弹窗提交按钮
  function handleSubmit() {
    // 打开Form页面
    routeList.value.openRouteForm();
  }

  // 检验单
  async function handleCheck(record) {
    const res = await checkListData({ flowId: record.id });
    if (res.list.length > 1) {
      queryParams.value.flowId = record.id;
      //await nextTick(); //
      operCheckSelectRefs.value.openSelectModal();
    } else if (res.list.length == 1) {
      openDrawerCheck(true, { djNo: res.list[0].djNo });
    } else {
      showMessage(t('流程没有可检验的检验单信息！'));
    }
  }

  function orderCheckList(record) {
    orderFlow.value = record;
    openCheckDrawer(true, '');
  }

  // 外协
  function handleOut(record) {
    openDrawerOut(true, { selIds: record.id, ope: record.ope });
  }
  //发货
  function handleFH(record) {
    openDrawerFH(true, { selIds: record.id, bred: '0' });
  }

  // 检验
  async function handleCheckSelects(values: Recordable[]) {
    if (values.length == 0) {
      showMessage(t('请选择一条检验记录!'));
      return;
    }
    openDrawerCheck(true, {
      djNo: values[0].djNo,
      //'checkor.userCode': checkData.value.user.userCode,
    });
    selectListRef.value = []; // 清空选择的内容
  }

  function handleOrder(record) {
    openOrderFormDrawer(true, record);
  }

  //导出数据
  function btnExport() {
    var formdata = getForm().getFieldsValue();
    formdata = { ...formdata, 'order.id': props.data.id };
    handleExport('/m8/order/flow/exportData', formdata);
  }

  defineExpose({
    handleSuccess,
    handleRouterList,
  });
</script>
